fix: Removed the multiple prompt for marketplace encryption key#17
Open
cs-raj wants to merge 1 commit intov2-dev-bugfixfrom
Open
fix: Removed the multiple prompt for marketplace encryption key#17cs-raj wants to merge 1 commit intov2-dev-bugfixfrom
cs-raj wants to merge 1 commit intov2-dev-bugfixfrom
Conversation
🔒 Security Scan Results
⏱️ SLA Breach Summary
ℹ️ Vulnerabilities Without Available Fixes (Informational Only)The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:
✅ BUILD PASSED - All security checks passed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
version bump: done
Fix: Duplicate Marketplace App Configurations Encryption Key Prompt on Export
Problem
When running
cm:stacks:exportwithout the-yflag (i.e. when not forcing marketplace prompts), the "Enter Marketplace app configurations encryption key" prompt was shown twice before the marketplace apps progress bar, causing a confusing UX.Root Cause
In the export flow, the encryption key was requested in two places for the same run:
ExportMarketplaceApps.start()– A "validate before progress" block explicitly calledaskEncryptionKey(this.exportConfig). The return value was not used.createNodeCryptoInstance()(marketplace-app-helper) – WhenforceStopMarketplaceAppsPromptis false, this function also callsaskEncryptionKey(config)to get the key before creating theNodeCryptoinstance.So the user was prompted once in
start()and again whencreateNodeCryptoInstance()ran immediately after.Solution
await askEncryptionKey(this.exportConfig)call fromstart()incli-plugins/packages/contentstack-export/src/export/modules/marketplace-apps.ts.askEncryptionKeyimport from that file.createNodeCryptoInstance(this.exportConfig), which performs the single prompt internally.No changes were made to
marketplace-app-helper.tsor to the import plugin source; import already prompted once viagetAndValidateEncryptionKey().Tests Added
Export (
contentstack-export)test/unit/export/modules/marketplace-apps.test.tsshould call createNodeCryptoInstance exactly once when prompting for encryption key before progressstart()runs withforceStopMarketplaceAppsPrompt: falseand apps are present,createNodeCryptoInstanceis invoked exactly once, preventing regression of the double-prompt.Import (
contentstack-import)test/unit/import/modules/marketplace-apps.test.tsshould call getAndValidateEncryptionKey exactly once when prompt is not forced and start runsstart()runs with prompt not forced,getAndValidateEncryptionKeyis called exactly once, documenting and guarding the existing single-prompt behaviour.Verification
cm:stacks:exportwith a stack that has marketplace apps, without-y, and confirm the encryption key prompt appears once before the progress bar.